import request from '@/common/request/request.js'
import config from '@/common/config/config.js';
const http = config.env

// 查找累计消费与订单数
export const totalConsumption = data => {
	return request({
		url: http.baseUrl + '/order/totalConsumption',
		method: 'GET',
		data: data
	})
}

// 周薪订单列表
export const weekOrder = data => {
	return request({
		url: http.baseUrl + '/order/week/order',
		method: 'GET',
		data: data
	})
}

// 周薪
export const weeklyWage = data => {
	return request({
		url: http.baseUrl + '/order/weeklyWage',
		method: 'GET',
		data: data
	})
}

// 支付方式
export const orderPayMethod = data => {
	return request({
		url: http.baseUrl + '/order/payMethod',
		method: 'GET',
		data: data
	})
}

// 千一赠送明细
export const qianyiLog = (awardId, data) => {
	return request({
		url: http.baseUrl + '/order/qianyiLog/' + awardId,
		method: 'GET',
		data: data
	})
}

// 订单奖励
export const orderAward = data => {
	return request({
		url: http.baseUrl + '/order/orderAward',
		method: 'GET',
		data: data
	})
}

// 订单列表
export const orderList = data => {
	return request({
		url: http.baseUrl + '/order/orderList/',
		method: 'GET',
		data: data
	})
}
// 订单详情
export const orderDetail = (orderId) => {
	return request({
		url: http.baseUrl + '/order/orderDetail/' + orderId,
		method: 'GET'
	})
}
// 创建订单
export const orderCreate = data => {
	return request({
		url: http.baseUrl + '/order/create',
		method: 'POST',
		data: data
	})
}

// 确认收货
export const orderFinish = (orderId,isAgree) => {
	return request({
		url:`${http.baseUrl}/order/finish/${orderId}?arriveToday=${isAgree}`,
		method: 'POST'
	})
}

// 支付订单
export const orderPay = data => {
	return request({
		url: http.baseUrl + '/order/pay',
		method: 'POST',
		data: data
	})
}

// 银行卡验证码支付验证
export const bankPayVerifyCode = data => {
	return request({
		url: http.baseUrl + '/order/bankPayVerifyCode',
		method: 'POST',
		data: data
	})
}

// 取消订单
export const orderCancel = orderId => {
	return request({
		url: http.baseUrl + '/order/cancel/' + orderId,
		method: 'POST'
	})
}
// 支付方式
export const orderMethods = data => {
	return request({
		url: http.baseUrl + '/order/payMethodSecond',
		method: 'GET',
		data: data
	})
}
// 申请售后
export const applyOrder = data => {
	return request({
		url: http.baseUrl + '/refund/applyRefund',
		method: 'post',
		data: data
	})
}

